Skip to main content

Last Update: 2025/3/26

Gizmo OpenAI Uploaded API

The Gizmo OpenAI Uploaded API allows you to upload a file to a specific conversation.

Endpoint

POST https://platform.llmprovider.ai/v1/uploaded

Request Headers

HeaderValue
AuthorizationBearer YOUR_API_KEY
Content-Typeapplication/json

Request Body

The request body should be a FormData object with the following parameters:

ParameterTypeDescription
conversation_idstringThe ID of the conversation.
upload_typestringThe type of the upload. my_files or multimodal
filesmultipart.FileHeaderThe file to be uploaded(file maxsize <= 20M). multimodal: "image/webp", "image/jpeg", "image/gif", "image/png"
my_files: "application/vnd.openxmlformats-officedocument.presentationml.presentation", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "application/json", "text/x-tex", "application/x-latext", "text/plain", "application/pdf", "text/x-java", "text/markdown", "text/x-script.python", "text/x-ruby", "application/msword", "text/javascript", "text/x-php", "text/x-typescript", "text/x-sh", "text/x-c++", "text/x-csharp", "text/x-c", "text/html"
modelstringThe model to be used.(gizmo-gpt-4o)

Request Example

POST /api/gizmo/upload HTTP/1.1
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW

------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="conversation_id"

12345
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="upload_type"

image
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="files"; filename="example.png"
Content-Type: image/png

<file content>
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="model"

gizmo-gpt-4o
------WebKitFormBoundary7MA4YWxkTrZu0gW--

Response Body

The response body will be a JSON object containing the generated completions and other metadata.

FieldTypeDescription
idstringUnique identifier for the uploaded file.
namestringName of the uploaded file.
sizeint64Size of the uploaded file in bytes.
download_urlstringURL to download the file (optional).
image_widthintWidth of the image (optional).
image_heightintHeight of the image (optional).
use_casestringUse case of the file (optional).
fileTokenSizeintToken size of the file (optional).
mimeTypestringMIME type of the file.
conversation_idstringID of the conversation (optional).

Response Example

{
"id": "12345",
"name": "example.png",
"size": 12345,
"download_url": "https://platform.llmprovider.ai/v1/download/12345",
"image_width": 800,
"image_height": 600,
"use_case": "my_files",
"fileTokenSize": 100,
"mimeType": "image/png",
"conversation_id": "12345"
}

Example Request

curl -X POST https://platform.llmprovider.ai/v1/uploaded \
-H "Authorization: Bearer $YOUR_API_KEY" \
-H "Content-Type: multipart/form-data" \
-F "upload_type=my_files" \
-F "files=@/root/ceshi.txt" \
-F "model=gizmo-gpt-4o"

For any questions or further assistance, please contact us at [email protected].